package cn.kinoko.controller.ai;

import cn.kinoko.common.base.model.BaseController;
import cn.kinoko.model.ai.chat.ChatMsg;
import cn.kinoko.service.ai.ChatAIService;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author kk
 */
@RestController
@RequestMapping("/ai/chat")
public class ChatAIController extends BaseController {

    @Resource
    private ChatAIService chatAIService;

    @PostMapping("/translator")
    public Object translator(@RequestBody @Validated ChatMsg chatMsg) {
        return success(chatAIService.translationAssistant(chatMsg.getContent()));
    }

}
